﻿using Abp.Application.Services.Dto;
using Abp.AutoMapper;
using RMM.Core.Entity.Shops;
using RMM.Core.ShopService;
using RMM.ShopAppService.Dtos;
using System;
using System.Collections.Generic;
using Abp.Linq.Extensions;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using RMM.FrameWork;

namespace RMM.ShopAppService
{
    public class ShopAdminAppService
    {
        private readonly IShopService _shopService;

        public ShopAdminAppService(IShopService shopService)
        {
            _shopService = shopService;
        }


        //public async Task<PagedResultDto<ShopListDto>> GetShopListAsync(ShopInputDto dto)
        //{
        //    var shops = await _shopService.GetAll();
        //    var projects = await _shopService.GetShopProjectQueryable();

        //    projects = projects
        //        .WhereIf(CommonHelper.Check(dto.ProjectId), p => p.Id == dto.ProjectId);

        //    shops = shops
        //        .WhereIf(dto.ApprovalStatus != Enums.ApprovalStatusEnum.All, p => p.ApprovalStatus == (int)dto.ApprovalStatus)
        //        .WhereIf(CommonHelper.Check(dto.ShopName), p => p.ShopName.Contains(dto.ShopName));

        //    var shopArgs = shops.Join(projects, shop => shop.ProjectId, proj => proj.Id, (shop, proj) => new ShopArgsDto());

        //    var item = shops.OrderByDescending(p => p.Id).PageBy(dto);
        //    var count = shops.Count();

        //    var returnDto = new PagedResultDto<ShopListDto>()
        //    {
        //        Items = item.MapTo<List<ShopListDto>>(),
        //        TotalCount = count
        //    };
        //    return returnDto;
        //}


    }
    

}
